home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 142
/
Volume 142 Oct 17 2011 - Damaged.iso
/
Games
/
rapid-fire.swf
/
scripts
/
__Packages
/
TimerControl.as
< prev
Wrap
Text File
|
2011-10-17
|
747b
|
26 lines
class TimerControl
{
function TimerControl()
{
this.timer_init = _root.level_time * 1000;
this.timer_offset = getTimer();
}
function Update()
{
var _loc1_ = this;
var _loc2_ = _root;
_loc1_.time_disp = getTimer() - _loc1_.timer_offset;
_loc1_.level_time = (_loc1_.timer_init - (getTimer() - _loc1_.timer_offset)) / 1000;
_loc2_.timer_mc.gotoAndStop(Math.floor((1 - _loc1_.level_time / _loc2_.level_time) * 400));
if(_loc1_.level_time < 0)
{
_loc2_.paused = true;
_loc2_.attachMovie("level_end","level_end",_loc2_.pause_clip_depth);
}
}
function PauseOFF()
{
this.timer_offset = getTimer() - this.time_disp;
}
}